See Original text in context
Flattens objects of type Capture, Pair, List
, Map and Hash into an argument list.
sub slurpee( |args );slurpee( <a b c d>, , 'e' => 'f' => 33 )# OUTPUT: «\(("a", "b", "c", "d"), {:e(3)}, :e(:f(33)))»
Please see the Signature
page, specially the section on Captures for more information on the subject.
Outside of argument lists, it returns a Slip, which makes it flatten into the outer list. Inside argument list Positional
s are turned into positional arguments and Associative
s are turned into named arguments.
See Original text in context
multi sub infix:<|>(, --> Junction) is assoc<list>
Creates an any Junction from its arguments.
my = // | /<[i j k]>/ | /<[x y z]>/;say .raku; # OUTPUT: «any(/<[a b c]>/, /<[i j k]>/, /<[x y z]>/)»say 'b' ~~ ; # OUTPUT: «True»
This first creates an any
Junction
of three regular expressions (every one of them matching any of 3 letters), and then uses smartmatching to check whether the letter b
matches any of them, resulting in a positive match. See also Junction for more details.